package org.easy.core.enums;

import lombok.Getter;

@Getter
public enum PayPlatform {

    ALIPAY(1, "支付宝"),
    WECHAT(2, "微信");

    private final int code;
    private final String description;

    PayPlatform(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static PayPlatform fromCode(int code) {
        for (PayPlatform platform : PayPlatform.values()) {
            if (platform.getCode() == code) {
                return platform;
            }
        }
        return null;
    }
}